const $http = (url,data={},mothod="GET",header={})=>{
	let baseUrl = 'https://www.fastmock.site/mock/b5b84dc2a6df42eb062ed5ee7bd72b4a/uni'
	let promise = new Promise((resolve,reject)=>{
			uni.request({
			    url: baseUrl+url,
				data,
				mothod,
				header,
			}).then(res=>{
				if(res[1].data.code ==200){
					resolve(res[1])
				}else{
					reject(res[1])
				}
			}).catch(err=>{
				reject(err)
			})
	})
	
	return promise
}

export default $http